#pragma once
#include <Eigen/sparse>
#include <vector>
typedef Eigen::SparseMatrix<double> SpMat;

class Section_Data;

class Section_Base;

class Section_Analysis
{
public:
	Section_Analysis(const Section_Data& data);

	bool analysis(std::shared_ptr<Section_Base> m_Section);

private:
	std::vector<SpMat> m_K11, m_K22, m_K12;
	std::vector<Eigen::VectorXd> x1, x2, F1, F2;

	std::vector<int> m_nFixed;
	std::vector<int> m_nFree;
	int DOFNode;

	const Section_Data& m_Data;
	std::weak_ptr<Section_Base> Section;

	void Pretreatment();
	void AssignDOF();
	void AssembleKs();
	void TreatBoundary();
	void AssembleLoad();
	void solve();
	void Post_Processing();
	void AssembleLoad2();
	void solve2();
	void getNodesW();
	void foutNode();
	void foutElement();
};

